<?php
require_once 'conexao.php';

$placa = strtoupper(strtr($_POST['placa_fila'], "áéíóúâêôãõàèìòùç", "ÁÉÍÓÚÂÊÔÃÕÀÈÌÒÙÇ"));

if ((empty($placa))) {
    echo "<script type='text/javascript'>
     alert('Todos campos devem ser preenchidos corretamente.'); document.location.href='\index.php?pagina=prestador'
     </script> ";
}
else{
    $query = "INSERT INTO fila (placa,data,hora,port) VALUES ('" . $placa . "', NOW(), NOW(),'" . $_SESSION['login'] . "')";
    mysql_query($query);
}
echo "<script type='text/javascript'>
     alert('Veículo na fila'); document.location.href='\index.php?pagina=prestador'
     </script> ";
?>
